home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 531 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file C source text default
99% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2c | 63 6f 6d 70 2e 6c 61 6e |.lang.c,|comp.lan|
|00000020| 67 2e 63 2b 2b 0a 50 61 | 74 68 3a 20 70 6c 61 74 |g.c++.Pa|th: plat|
|00000030| 69 6e 75 6d 2e 63 6f 6d | 21 6e 6f 62 6f 64 79 0a |inum.com|!nobody.|
|00000040| 46 72 6f 6d 3a 20 52 75 | 64 20 4d 65 72 72 69 61 |From: Ru|d Merria|
|00000050| 6d 20 3c 72 6d 65 72 72 | 69 61 6d 40 73 6f 66 74 |m <rmerr|iam@soft|
|00000060| 69 6e 74 2e 63 6f 6d 3e | 0a 53 75 62 6a 65 63 74 |int.com>|.Subject|
|00000070| 3a 20 52 65 3a 20 22 23 | 64 65 66 69 6e 65 22 20 |: Re: "#|define" |
|00000080| 76 65 72 73 75 73 20 22 | 63 6f 6e 73 74 22 0a 4d |versus "|const".M|
|00000090| 65 73 73 61 67 65 2d 49 | 44 3a 20 3c 33 30 45 41 |essage-I|D: <30EA|
|000000a0| 46 41 44 37 2e 46 30 33 | 40 73 6f 66 74 69 6e 74 |FAD7.F03|@softint|
|000000b0| 2e 63 6f 6d 3e 0a 53 65 | 6e 64 65 72 3a 20 6e 6f |.com>.Se|nder: no|
|000000c0| 62 6f 64 79 40 67 61 74 | 65 77 61 79 2e 70 6c 61 |body@gat|eway.pla|
|000000d0| 74 69 6e 75 6d 2e 63 6f | 6d 0a 4d 69 6d 65 2d 56 |tinum.co|m.Mime-V|
|000000e0| 65 72 73 69 6f 6e 3a 20 | 31 2e 30 0a 58 2d 4d 61 |ersion: |1.0.X-Ma|
|000000f0| 69 6c 65 72 3a 20 4d 6f | 7a 69 6c 6c 61 20 32 2e |iler: Mo|zilla 2.|
|00000100| 30 62 33 20 28 57 69 6e | 4e 54 3b 20 49 29 0a 43 |0b3 (Win|NT; I).C|
|00000110| 6f 6e 74 65 6e 74 2d 54 | 79 70 65 3a 20 74 65 78 |ontent-T|ype: tex|
|00000120| 74 2f 70 6c 61 69 6e 3b | 20 63 68 61 72 73 65 74 |t/plain;| charset|
|00000130| 3d 75 73 2d 61 73 63 69 | 69 0a 4f 72 67 61 6e 69 |=us-asci|i.Organi|
|00000140| 7a 61 74 69 6f 6e 3a 20 | 50 6c 61 74 69 6e 75 6d |zation: |Platinum|
|00000150| 20 74 65 63 68 6e 6f 6c | 6f 67 79 20 69 6e 63 2e | technol|ogy inc.|
|00000160| 20 5c 20 53 6f 66 74 77 | 61 72 65 20 49 6e 74 65 | \ Softw|are Inte|
|00000170| 72 66 61 63 65 73 0a 44 | 61 74 65 3a 20 57 65 64 |rfaces.D|ate: Wed|
|00000180| 2c 20 33 20 4a 61 6e 20 | 31 39 39 36 20 32 31 3a |, 3 Jan |1996 21:|
|00000190| 35 33 3a 32 37 20 47 4d | 54 0a 52 65 66 65 72 65 |53:27 GM|T.Refere|
|000001a0| 6e 63 65 73 3a 20 3c 34 | 62 39 37 6d 74 24 72 67 |nces: <4|b97mt$rg|
|000001b0| 70 40 77 75 6d 70 75 73 | 2e 63 63 2e 75 6f 77 2e |p@wumpus|.cc.uow.|
|000001c0| 65 64 75 2e 61 75 3e 20 | 3c 33 30 64 38 64 30 61 |edu.au> |<30d8d0a|
|000001d0| 32 2e 36 36 31 36 34 34 | 38 40 6e 6e 74 70 2e 69 |2.661644|8@nntp.i|
|000001e0| 78 2e 6e 65 74 63 6f 6d | 2e 63 6f 6d 3e 20 3c 6a |x.netcom|.com> <j|
|000001f0| 75 67 67 6c 65 72 2e 38 | 31 39 36 38 30 30 38 30 |uggler.8|19680080|
|00000200| 40 69 71 75 65 73 74 2e | 6e 65 74 3e 20 3c 33 30 |@iquest.|net> <30|
|00000210| 64 63 62 32 33 37 2e 31 | 39 30 36 36 33 36 38 40 |dcb237.1|9066368@|
|00000220| 6e 6e 74 70 2e 69 78 2e | 6e 65 74 63 6f 6d 2e 63 |nntp.ix.|netcom.c|
|00000230| 6f 6d 3e 20 3c 34 62 70 | 6c 6d 62 24 65 33 40 6e |om> <4bp|lmb$e3@n|
|00000240| 65 77 73 2e 6e 61 63 6d | 2e 63 6f 6d 3e 20 3c 33 |ews.nacm|.com> <3|
|00000250| 30 65 30 38 31 32 38 2e | 37 36 39 36 30 35 31 32 |0e08128.|76960512|
|00000260| 40 6e 6e 74 70 2e 69 78 | 2e 6e 65 74 63 6f 6d 2e |@nntp.ix|.netcom.|
|00000270| 63 6f 6d 3e 0a 54 6f 3a | 20 4d 69 6b 65 20 52 75 |com>.To:| Mike Ru|
|00000280| 62 65 6e 73 74 65 69 6e | 20 3c 6d 69 6b 65 72 33 |benstein| <miker3|
|00000290| 40 69 78 2e 6e 65 74 63 | 6f 6d 2e 63 6f 6d 3e 0a |@ix.netc|om.com>.|
|000002a0| 43 6f 6e 74 65 6e 74 2d | 54 72 61 6e 73 66 65 72 |Content-|Transfer|
|000002b0| 2d 45 6e 63 6f 64 69 6e | 67 3a 20 37 62 69 74 0a |-Encodin|g: 7bit.|
|000002c0| 0a 4d 69 6b 65 20 52 75 | 62 65 6e 73 74 65 69 6e |.Mike Ru|benstein|
|000002d0| 20 77 72 6f 74 65 3a 0a | 3e 20 0a 0a 5b 6d 75 6e | wrote:.|> ..[mun|
|000002e0| 63 68 5d 0a 20 0a 3e 20 | 53 6f 6d 65 6f 6e 65 20 |ch]. .> |Someone |
|000002f0| 70 6f 73 74 65 64 20 61 | 20 72 65 73 70 6f 6e 73 |posted a| respons|
|00000300| 65 20 61 67 72 65 65 69 | 6e 67 2c 20 62 75 74 20 |e agreei|ng, but |
|00000310| 61 64 64 69 6e 67 20 74 | 68 61 74 20 49 20 73 68 |adding t|hat I sh|
|00000320| 6f 75 6c 64 20 68 61 76 | 65 0a 3e 20 70 6f 69 6e |ould hav|e.> poin|
|00000330| 74 65 64 20 6f 75 74 20 | 74 68 61 74 20 63 6f 6e |ted out |that con|
|00000340| 73 74 20 61 6c 6c 6f 77 | 73 20 74 79 70 65 20 63 |st allow|s type c|
|00000350| 68 65 63 6b 69 6e 67 2e | 20 20 49 20 71 75 65 73 |hecking.| I ques|
|00000360| 74 69 6f 6e 65 64 20 77 | 68 65 74 68 65 72 0a 3e |tioned w|hether.>|
|00000370| 20 63 6f 6e 73 74 20 70 | 72 6f 76 69 64 65 73 20 | const p|rovides |
|00000380| 61 6e 79 20 62 65 74 74 | 65 72 20 74 79 70 65 20 |any bett|er type |
|00000390| 63 68 65 63 6b 69 6e 67 | 20 74 68 61 6e 20 23 64 |checking| than #d|
|000003a0| 65 66 69 6e 65 2e 20 20 | 49 20 68 61 76 65 20 6e |efine. |I have n|
|000003b0| 6f 74 0a 3e 20 61 64 76 | 6f 63 61 74 65 64 20 75 |ot.> adv|ocated u|
|000003c0| 73 69 6e 67 20 23 64 65 | 66 69 6e 65 20 66 6f 72 |sing #de|fine for|
|000003d0| 20 63 6f 6e 73 74 61 6e | 74 73 20 69 6e 20 43 2b | constan|ts in C+|
|000003e0| 2b 2e 0a 3e 20 0a 3e 20 | 4d 69 63 68 61 65 6c 20 |+..> .> |Michael |
|000003f0| 4d 20 52 75 62 65 6e 73 | 74 65 69 6e 0a 0a 54 68 |M Rubens|tein..Th|
|00000400| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 63 6f 64 65 |e follow|ing code|
|00000410| 20 61 74 20 6c 65 61 73 | 74 20 64 65 6d 6f 6e 73 | at leas|t demons|
|00000420| 74 72 61 74 65 73 20 74 | 68 61 74 20 43 2b 2b 20 |trates t|hat C++ |
|00000430| 73 65 65 73 20 73 6f 6d | 65 74 68 69 6e 67 20 64 |sees som|ething d|
|00000440| 69 66 66 65 72 65 6e 74 | 20 69 6e 20 0a 74 68 65 |ifferent| in .the|
|00000450| 20 74 79 70 65 73 20 6f | 66 20 61 20 23 64 65 66 | types o|f a #def|
|00000460| 69 6e 65 20 61 6e 64 20 | 61 20 63 6f 6e 73 74 2e |ine and |a const.|
|00000470| 20 54 68 69 73 20 64 69 | 66 66 65 72 65 6e 63 65 | This di|fference|
|00000480| 20 69 73 20 61 74 20 6c | 65 61 73 74 20 61 20 70 | is at l|east a p|
|00000490| 69 74 66 61 6c 6c 20 66 | 6f 72 20 0a 74 68 65 20 |itfall f|or .the |
|000004a0| 75 6e 77 61 72 79 20 75 | 73 65 72 73 20 6f 66 20 |unwary u|sers of |
|000004b0| 23 64 65 66 69 6e 65 20 | 73 69 6e 63 65 20 49 4d |#define |since IM|
|000004c0| 4f 20 6d 61 6e 79 20 74 | 68 69 6e 6b 20 6f 66 20 |O many t|hink of |
|000004d0| 23 64 65 66 69 6e 65 73 | 20 61 73 20 63 6f 6e 73 |#defines| as cons|
|000004e0| 74 61 6e 74 73 2e 20 0a | 0a 0a 23 69 6e 63 6c 75 |tants. .|..#inclu|
|000004f0| 64 65 20 3c 69 6f 73 74 | 72 65 61 6d 2e 68 3e 0a |de <iost|ream.h>.|
|00000500| 0a 23 64 65 66 69 6e 65 | 20 64 65 66 69 6e 74 20 |.#define| defint |
|00000510| 31 0a 63 6f 6e 73 74 20 | 69 6e 74 20 63 6f 6e 69 |1.const |int coni|
|00000520| 6e 74 20 3d 20 32 3b 0a | 69 6e 74 20 6e 6f 6e 63 |nt = 2;.|int nonc|
|00000530| 6f 6e 20 3d 20 32 3b 0a | 0a 76 6f 69 64 20 66 28 |on = 2;.|.void f(|
|00000540| 63 6f 6e 73 74 20 69 6e | 74 26 20 69 29 20 7b 20 |const in|t& i) { |
|00000550| 63 65 72 72 20 3c 3c 20 | 22 66 28 63 6f 6e 73 74 |cerr << |"f(const|
|00000560| 20 69 6e 74 26 29 20 22 | 20 3c 3c 20 69 20 3c 3c | int&) "| << i <<|
|00000570| 20 27 5c 6e 27 3b 20 7d | 0a 76 6f 69 64 20 66 28 | '\n'; }|.void f(|
|00000580| 69 6e 74 26 20 69 29 20 | 7b 63 65 72 72 20 3c 3c |int& i) |{cerr <<|
|00000590| 20 22 66 28 69 6e 74 26 | 29 20 22 20 3c 3c 20 69 | "f(int&|) " << i|
|000005a0| 20 3c 3c 20 27 5c 6e 27 | 3b 20 7d 0a 0a 69 6e 74 | << '\n'|; }..int|
|000005b0| 20 6d 61 69 6e 28 29 0a | 7b 0a 20 20 20 66 28 64 | main().|{. f(d|
|000005c0| 65 66 69 6e 74 29 3b 0a | 20 20 20 66 28 63 6f 6e |efint);.| f(con|
|000005d0| 69 6e 74 29 3b 0a 20 20 | 20 66 28 6e 6f 6e 63 6f |int);. | f(nonco|
|000005e0| 6e 29 3b 0a 0a 20 20 20 | 63 68 61 72 20 63 68 3b |n);.. |char ch;|
|000005f0| 0a 20 20 20 63 69 6e 20 | 3e 3e 20 63 68 3b 0a 20 |. cin |>> ch;. |
|00000600| 20 20 72 65 74 75 72 6e | 20 30 3b 0a 20 20 20 7d | return| 0;. }|
|00000610| 0a 0a 0a 20 0a 52 75 64 | 20 4d 65 72 72 69 61 6d |... .Rud| Merriam|
|00000620| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000630| 20 20 20 20 20 20 20 20 | 20 20 76 6f 69 63 65 3a | | voice:|
|00000640| 28 37 31 33 29 20 34 39 | 32 2d 30 37 30 37 20 78 |(713) 49|2-0707 x|
|00000650| 31 31 38 0a 50 4c 41 54 | 49 4e 55 4d 20 74 65 63 |118.PLAT|INUM tec|
|00000660| 68 6e 6f 6c 6f 67 79 2c | 20 49 6e 63 2e 20 20 20 |hnology,| Inc. |
|00000670| 20 20 20 20 20 20 20 20 | 20 66 61 78 3a 20 20 28 | | fax: (|
|00000680| 37 31 33 29 20 34 39 32 | 2d 30 37 32 35 0a 53 6f |713) 492|-0725.So|
|00000690| 66 74 77 61 72 65 20 49 | 6e 74 65 72 66 61 63 65 |ftware I|nterface|
|000006a0| 73 20 4c 61 62 20 20 20 | 20 20 20 20 20 20 20 20 |s Lab | |
|000006b0| 20 20 20 6d 65 72 72 69 | 61 6d 40 70 6c 61 74 69 | merri|am@plati|
|000006c0| 6e 75 6d 2e 63 6f 6d 0a | 31 34 30 30 20 42 72 6f |num.com.|1400 Bro|
|000006d0| 61 64 66 69 65 6c 64 2c | 20 53 75 69 74 65 20 36 |adfield,| Suite 6|
|000006e0| 30 30 2c 20 20 20 20 20 | 20 20 20 20 20 43 49 53 |00, | CIS|
|000006f0| 3a 20 37 34 34 33 31 2c | 31 36 32 30 0a 48 6f 75 |: 74431,|1620.Hou|
|00000700| 73 74 6f 6e 2c 20 54 58 | 20 37 37 30 38 34 0a |ston, TX| 77084. |
+--------+-------------------------+-------------------------+--------+--------+